Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/runtime-corejs3

Package Overview
Dependencies
Maintainers
4
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/runtime-corejs3

babel's modular runtime helpers with core-js@3 polyfilling

  • 7.26.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7M
decreased by-0.11%
Maintainers
4
Weekly downloads
 
Created

What is @babel/runtime-corejs3?

The @babel/runtime-corejs3 package is a runtime library for Babel that includes polyfills for ECMAScript features using core-js version 3. It is used alongside Babel to enable the use of new JavaScript features in environments that do not natively support them. This package helps to avoid polluting the global scope and reduces the size of the compiled code by deduplicating helper functions.

What are @babel/runtime-corejs3's main functionalities?

Polyfilling ECMAScript features

This code imports polyfills for stable ECMAScript features and the regenerator runtime needed to use generators and async functions.

import 'core-js/stable';
import 'regenerator-runtime/runtime';

Usage of built-in methods

This code demonstrates how to use the map method from core-js through the runtime without polluting the global Array prototype.

import { map } from '@babel/runtime-corejs3/core-js-stable/instance/map';

let arr = [1, 2, 3];
let mapped = map.call(arr, x => x * x);

Usage of new syntax features

This code shows how to use the helpers provided by @babel/runtime-corejs3 to work with new syntax features like async functions and generators.

import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';

const asyncFunc = _asyncToGenerator(function* () {
  yield Promise.resolve('Hello World');
});

Other packages similar to @babel/runtime-corejs3

FAQs

Package last updated on 25 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc